import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/LoginView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: LoginView
  },
  {
    path: '/login',
    name: 'login',
    component: LoginView
  },
  {
    path: '/home',
    name: 'home', //写了后，会有以下警告信息：
    // Named Route 'home' has a default child route.  When navigating to this named route (:to="name: 'home'}"), the default child route will not be rendered.  Remove the name from this route and use the name of the default child route for named links instead.
    meta: { pagetitle: ['首页'] },
    component: () => import('../views/HomeView.vue')
    /*  children: [
       {
         path: '',
         name: 'defaulthomechildren',
         meta: { pagetitle: ['首页', '工作台'] },
         component: () => import('../views/SiteView.vue')
       },
       {
         path: 'site',
         name: 'site',
         meta: { pagetitle: ['首页', '工作台'] },
         component: () => import('../views/SiteView.vue')
       },
       {
         path: 'customems',
         meta: { pagetitle: ['首页', '客户管理'] },
 
         component: () => import('../views/CustomerMg.vue')
       },
       {
         path: 'addcustomer',
         meta: { pagetitle: ['首页', '客户管理', '添加客户'] },
         component: () => import('../views/AddCustomer.vue')
       },
       {
         path: 'customedetail',
         meta: { pagetitle: ['首页', '客户管理', '客户信息详细'] },
 
         component: () => import('../views/CustomeDetail.vue')
       },
       {
         path: 'customemstype',
         meta: { pagetitle: ['首页', '客户类型管理'] },
         component: () => import('../views/CustomeType.vue')
       },
       {
         path: 'waterqualitymg',
         meta: { pagetitle: ['首页', '仪表管理'] },
         component: () => import('../views/WaterQualityMg.vue')
       },
       {
         path: 'waterqualitytype',
         meta: { pagetitle: ['首页', '仪表类型管理'] },
         component: () => import('../views/WaterQualityType.vue')
       },
       {
         path: 'waterquality_type_detail',
         meta: { pagetitle: ['首页', '仪表管理', '仪表类型详情'] },
         component: () => import('../views/WaterQualityTypeDetail.vue')
       },
       {
         path: 'waterqualityadd',
         meta: { pagetitle: ['首页', '仪表管理', '新增仪表类型'] },
         component: () => import('../views/WaterQualityAdd.vue')
       },
       {
         path: 'waterquality_detail',
         meta: { pagetitle: ['首页', '仪表管理', '仪表详情'] },
         component: () => import('../views/WaterQualityDetail.vue')
       },
       {
         path: 'districtmg',
         meta: { pagetitle: ['首页', '区域管理'] },
         component: () => import('../views/DistrictMg.vue')
       },
       {
         path: 'accountingmg',
         meta: { pagetitle: ['首页', '基价设置'] },
         component: () => import('../views/AccountingMg.vue')
       },
       {
         path: 'accountingtype',
         meta: { pagetitle: ['首页', '计费类型管理'] },
         component: () => import('../views/AccountingType.vue')
       },
       {
         path: 'meter_records',
         meta: { pagetitle: ['首页', '收费管理', '抄表记录'] },
         component: () => import('../views/ChargeMg.vue')
       },
       {
         path: 'bill',
         meta: { pagetitle: ['首页', '收费管理', '生成账单'] },
         component: () => import('../views/BillCreate.vue')
       },
       {
         path: 'bill_detail',
         meta: { pagetitle: ['首页', '收费管理', '账单详细'] },
         component: () => import('../views/BillDetail.vue')
       },
       {
         path: 'pay_cost',
         meta: { pagetitle: ['首页', '收费管理', '缴费管理'] },
         component: () => import('../views/PayCostMg.vue')
       },
       {
         path: 'notice',
         meta: { pagetitle: ['首页', '通知公告管理'] },
         component: () => import('../views/NoticeMg.vue')
       },
 
       {
         path: 'statistic_nalysis',
         meta: { pagetitle: ['首页', '统计分析'] },
         component: () => import('../views/StatisticAnalysis.vue')
       },
       {
         path: 'systemaccount',
         meta: { pagetitle: ['首页', '系统设置', '账号管理'] },
         component: () => import('../views/SystemAccountMg.vue')
       },
       {
         path: 'systemroles',
         meta: { pagetitle: ['首页', '系统设置', '角色管理'] },
         component: () => import('../views/SystemRolesMg.vue')
       }
     ] */
  }
]

const router = new VueRouter({
  routes
})

export default router
